package cn.xzqwjw.taskmanager.domain.pojo;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;

import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotNull;

/**
 * @author rush
 */
@TableName(value = "sys_region_china")
@EqualsAndHashCode(callSuper = true)
@Data
public class SysRegionChina extends Model<SysRegionChina> implements Serializable {

  @TableField(exist = false)
  private static final long serialVersionUID = 1L;

  @Override
  public Serializable pkVal() {
    return this.code;
  }

  @TableId("code")
  @NotNull(message = "code不能为空")
  @Length(max = 50, message = "code最多为50个字符")
  private String code;

  @NotNull(message = "label不能为空")
  @Length(max = 50, message = "label最多为 {max} 个字符")
  @TableField(value = "label")
  private String label;

  @Length(max = 50, message = "codeProvince最多为 {max} 个字符")
  @TableField(value = "code_province")
  private String provinceCode;

  @Length(max = 50, message = "codeCity最多为 {max} 个字符")
  @TableField(value = "code_city")
  private String cityCode;

  @Length(max = 50, message = "codeArea最多为 {max} 个字符")
  @TableField(value = "code_area")
  private String areaCode;

  @Length(max = 50, message = "codeStreet最多为 {max} 个字符")
  @TableField(value = "code_street")
  private String streetCode;

}